/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JpnlFinalSegment.java
 *
 * Created on 08/06/2010, 16:59:49
 */
package systole.view.tabs.finalsegment;

import java.awt.BorderLayout;
import systole.view.charts.XYChart;

/**
 *
 * @author user
 */
public class JpnlFinalSegment extends javax.swing.JPanel {

    /**
     *
     */
    private static final long serialVersionUID = -3620153491326823181L;

    /** Creates new form JpnlFinalSegment */
    public JpnlFinalSegment() {
        initComponents();        
    }

    public void loadSegment(XYChart finalSegment){
        this.jPnlCenter.removeAll();
        this.jPnlCenter.setLayout(new BorderLayout());
        finalSegment.setShowLegend(true);
        this.jPnlCenter.add(finalSegment.plot(), BorderLayout.CENTER);
        this.revalidate();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPnlCenter = new javax.swing.JPanel();
        jPnlTop = new javax.swing.JPanel();
        jPnlBottom = new javax.swing.JPanel();
        jPnlRigth = new javax.swing.JPanel();
        jPnlLeft = new javax.swing.JPanel();

        setName("Form"); // NOI18N
        setPreferredSize(new java.awt.Dimension(478, 315));
        setLayout(new java.awt.BorderLayout());

        jPnlCenter.setName("jPnlCenter"); // NOI18N
        jPnlCenter.setPreferredSize(new java.awt.Dimension(4, 4));
        jPnlCenter.setLayout(new java.awt.BorderLayout());
        add(jPnlCenter, java.awt.BorderLayout.CENTER);

        jPnlTop.setName("jPnlTop"); // NOI18N
        add(jPnlTop, java.awt.BorderLayout.PAGE_START);

        jPnlBottom.setName("jPnlBottom"); // NOI18N
        add(jPnlBottom, java.awt.BorderLayout.PAGE_END);

        jPnlRigth.setName("jPnlRigth"); // NOI18N
        add(jPnlRigth, java.awt.BorderLayout.LINE_END);

        jPnlLeft.setName("jPnlLeft"); // NOI18N
        add(jPnlLeft, java.awt.BorderLayout.LINE_START);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPnlBottom;
    private javax.swing.JPanel jPnlCenter;
    private javax.swing.JPanel jPnlLeft;
    private javax.swing.JPanel jPnlRigth;
    private javax.swing.JPanel jPnlTop;
    // End of variables declaration//GEN-END:variables
}
